import 'dart:convert';

import 'package:enterprise_v6_app/app/components/custom_refresh.dart';
import 'package:enterprise_v6_app/app/core/core.dart';
import 'package:enterprise_v6_app/app/data/common/choice_bean.dart';
import 'package:enterprise_v6_app/app/data/entities/application/education/teacher_power/lecturer_list_page_entity.dart';
import 'package:enterprise_v6_app/generated/json/base/json_field.dart';
import 'package:enterprise_v6_app/generated/json/get_new_dict_all_entity.g.dart';

export 'package:enterprise_v6_app/generated/json/get_dict_all_entity.g.dart';

@JsonSerializable()
class GetNewDictAllEntity implements ChoiceBean {
  GetNewDictAllEntity();

  factory GetNewDictAllEntity.fromJson(Map<String, dynamic> json) => $GetNewDictAllEntityFromJson(json);

  /// 列表刷新key
  @JSONField(deserialize: false, serialize: false)
  GlobalKey<CustomEasyRefreshListState> globalKey = GlobalKey();

  /// 筛选右侧栏控制Key
  @JSONField(deserialize: false, serialize: false)
  GlobalKey<ScaffoldState> riskRightScaffoldKey = GlobalKey<ScaffoldState>();
  /// 是否展开
  bool? isExpand = false;
  ///	创建人
  String? createBy = '';

  ///	创建人Id
  String? createById = '';

  ///	创建时间
  String? createDate = '';

  ///	正常-0 已删除-1
  String? deleted = '';

  ///	子字典列表
  List<GetNewDictAllEntity>? dictionaryDetails = [];

  ///	字典表id
  String? dictionaryId = '';

  ///	字典键值
  String? dictionaryKeyValues = '';

  ///	字典标签
  String? dictionaryLabel = '';

  ///	字典表排序字段
  int? dictionarySort = 0;

  ///	字典类型
  String? dictionaryType = '';

  ///	主键id
  String? id = '';

  String? pid = '';

  ///	备注
  String? remark = '';

  ///	修改人
  String? updateBy = '';

  ///	修改人Id
  String? updateById = '';

  ///	修改时间
  String? updateDate = '';

  /// 是否选中
  @JSONField(deserialize: false, serialize: false)
  bool isChecked = false;

  Map<String, dynamic> toJson() => $GetNewDictAllEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }

  @override
  String getId() {
    return id!;
  }

  @override
  bool getIsChecked() {
    return isChecked;
  }

  @override
  String getShowName() {
    return dictionaryLabel ?? '';
  }

  @override
  setIsChecked(bool isChecked) {
    this.isChecked = isChecked;
  }

  @JSONField(deserialize: false, serialize: false)
  dynamic defaultValue = 0;
  @JSONField(deserialize: false, serialize: false)
  dynamic defaultValueSelect = 0;
  @JSONField(deserialize: false, serialize: false)
  RxString searchX = ''.obs;
  @JSONField(deserialize: false, serialize: false)
  String searchSelect = '';
  @JSONField(deserialize: false, serialize: false)
  LecturerListPageEntity? lecturerListPageEntity;
  @JSONField(deserialize: false, serialize: false)
  String workKindBack2 = '';
  @JSONField(deserialize: false, serialize: false)
  RxString workKindNameBack2 = '请选择'.obs;
  @JSONField(deserialize: false, serialize: false)
  String startDate = '';
  @JSONField(deserialize: false, serialize: false)
  String endDate = '';

  ///调查里需要的字段
  @JSONField(deserialize: false, serialize: false)
  bool checkboxSelected = false;
}
